package com.winter.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.winter.model.CustomerMessage;
import com.winter.service.CustomerMessageService;
import com.winter.util.Result;

@RestController
@RequestMapping("/customermessage")
public class CustomerMessageController {

	@Autowired
	private CustomerMessageService service;

	/**
	 * 获取留言管理列表
	 * @param pageNumber
	 * @param pageSize
	 * @param createUser
	 * @return
	 */
	@GetMapping("/querypage")
	public Result queryPage(Integer pageNumber, Integer pageSize, String createUser, Long id) {
		return service.queryPage(pageNumber, pageSize, createUser, id);
	}
	
	/**
	 * 添加留言
	 * @param message
	 * @return
	 */
	@PostMapping("/insert")
	public Result insert(@RequestBody CustomerMessage message){
	   return service.insert(message);	
	}
}
